

namespace NodeBasedSkillEditor.Model.Node.RT
{
    public class Node_RadianToAngle_RT : RT_Node
    {
        public RT_SingleValuePort Radian_RT;

        public RT_SingleValuePort Angle_RT;

        public Node_RadianToAngle_RT(Node_RadianToAngle sourceData, RT_DAG parentDag) : base(sourceData, parentDag)
        {
            Radian_RT = new RT_SingleValuePort(EPortIOType.Input, sourceData.Radian, this);

            Angle_RT = new RT_SingleValuePort(EPortIOType.Output, sourceData.Angle, this);
            Angle_RT.OnGetValue = GetAngle;
        }

        public AValue GetAngle(DAG_Executor executor)
        {
            float radian = Radian_RT.GetValue(executor).ToScalar().Item2;
            float result = radian * 57.295779f;
            Angle_RT.SourceValue.SetScalar(result);
            return Angle_RT.SourceValue;
        }
    }
}